﻿#region << 文件说明 >>

/*----------------------------------------------------------------
 * 命名空间：Vampirewal.Core.Interface
 * 唯一标识：08cfa658-3475-44c6-8996-d1cc8f754057
 * 文件名：IVampirewalCoreEventAction
 *
 * 创建者：杨程
 * 电子邮箱：235160615@qq.com
 * 创建时间：2024/8/23 15:59:23
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/

#endregion << 文件说明 >>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Vampirewal.Core.Interface;

/// <summary>
/// 事件命令
/// </summary>
public interface IVampirewalCoreEventCommand
{
    /// <summary>
    /// 事件名称
    /// </summary>
    string EventName { get; }

    /// <summary>
    /// 执行命令的参数对应的属性名
    /// </summary>
    string ExcuteCommandParamterOfPropertyName { get; }

    /// <summary>
    /// 需要执行的命令
    /// </summary>
    ICommand ExcuteCommand { get; }
}

/// <summary>
/// 事件命令
/// </summary>
public sealed class VampirewalCoreEventCommand : IVampirewalCoreEventCommand
{
    /// <inheritdoc/>
    public string EventName { get; }

    /// <inheritdoc/>
    public string ExcuteCommandParamterOfPropertyName { get; }

    /// <inheritdoc/>
    public ICommand ExcuteCommand { get; }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="eventName"></param>
    /// <param name="excuteCommandParamterOfPropertyName"></param>
    /// <param name="excuteCommand"></param>
    public VampirewalCoreEventCommand(string eventName, string excuteCommandParamterOfPropertyName, ICommand excuteCommand)
    {
        EventName = eventName;
        ExcuteCommandParamterOfPropertyName = excuteCommandParamterOfPropertyName;
        ExcuteCommand = excuteCommand;
    }
}